package com.tangding.controller;

import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.tangding.common.exception.GException;
import com.tangding.pojo.response.MessageDto;

/**
 * @description 
 *
 * @author Ranger
 * @version 2017年11月7日_上午11:44:47
 *
 */
@RestController
@RequestMapping("/hello")
//@RequiresAuthentication
public class HelloController {
	
//	@Reference(version = Constants.SERVICE_VERSION, timeout = Constants.DUBBO_RPC_TIMEOUT)
//	UserService userService;
//	
//	@RequestMapping("/hi")
//	public MessageDto sayHi() throws GException {
//		Object result = userService.sayHi("123");
//		return MessageDto.responseSuccess(result);
//	}
	
	@RequestMapping("/hi")
	public MessageDto hi() throws GException {

		return MessageDto.responseSuccess();
	}
	
	@RequestMapping("/")
	public ModelAndView demo() throws GException {
		ModelAndView view = new ModelAndView();
		view.setViewName("index");
		view.addObject("hello", "游侠");
		return view;
	}
}
